package com.kuson.springcloud.service;

import com.kuson.springcloud.entities.CommonResult;
import com.kuson.springcloud.entities.Payment;
import com.kuson.springcloud.service.impl.PaymentFallbackService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * sentinel整合feign的服务接口，这里都是远程的服务接口
 * PaymentFallbackService 是一个微服务掉用失败之后，最后兜底的方法
 */
@FeignClient(value = "nacos-payment-provider",fallback = PaymentFallbackService.class)
public interface PaymentService {
    //远程微服务的名称
    @GetMapping(value = "/paymentSQL/{id}")
    public CommonResult<Payment> paymentSQL(@PathVariable("id") Long id);

}
